Skip to content

feat: add mcpp build support (mcpp.toml)#1

Merged
Sunrisepeak merged 2 commits intomasterfrom
feat/add-mcpp-support
May 9, 2026
Merged

feat: add mcpp build support (mcpp.toml)#1
Sunrisepeak merged 2 commits intomasterfrom
feat/add-mcpp-support

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Adds an mcpp.toml manifest alongside the existing xmake.lua so
tinyhttps can be consumed/built via both ecosystems.

What lands

  • mcpp.toml: declares modular C++23 lib tinyhttps exporting module
    mcpplibs.tinyhttps, sources src/**/*.cppm, runtime dep
    mbedtls 3.6.1 and dev dep gtest 1.15.2.

What's required upstream

A parallel PR adds the mbedtls 3.6.1 descriptor to
mcpp-community/mcpp-index.
That descriptor uses mcpp 0.0.2's C-language compile rule
(c_object) to compile all 108 of mbedtls's library/*.c into
libmbedtls.a, which mcpp's path-dep machinery then merges into
libtinyhttps.a. The two PRs land independently.

Verification

$ mcpp build
   Resolving toolchain
   ...
   Compiling mcpplibs.tinyhttps v0.2.0 (.)
      Cached mbedtls v3.6.1
    Finished release [optimized] in 1.52s

$ find target -name 'libtinyhttps.a'
target/x86_64-linux-musl/.../bin/libtinyhttps.a

$ ar t .../libtinyhttps.a | head
tls.m.o
sse.m.o
socket.m.o
proxy.m.o
http.m.o
ca_bundle.m.o
tinyhttps.m.o
x509write_csr.o
...

The archive contains all 6 module-interface objects plus mbedtls's
crypto + x509 + ssl translation units.

There's a benign warning from mcpp's module scanner about partition
imports (module 'mcpplibs.tinyhttps:http:tls' imported but not provided)
— it concatenates the source filename with the partition name when
guessing the logical name. GCC's dyndep step resolves it correctly,
the build/link succeed. Filed as a follow-up against mcpp-community/mcpp.

Adds the mcpp-build manifest alongside the existing xmake.lua so
tinyhttps can be consumed/built by both ecosystems. The mcpp side
relies on:

  * mbedtls 3.6.1 — pulled from mcpp-index (the descriptor lands in a
    parallel mcpp-community/mcpp-index PR). mcpp 0.0.2's C-language
    compile rule (`c_object`) builds mbedtls from source and packs
    it into libtinyhttps.a alongside the modular C++23 .m.o files.
  * gtest 1.15.2 — dev-only, picked up by `mcpp test` to run the
    existing tests/test_*.cpp.

Verified:
  $ mcpp build
    ...
    Compiling mcpplibs.tinyhttps v0.2.0 (.)
       Cached mbedtls v3.6.1
    Finished release [optimized] in 1.52s
  $ ar t target/.../bin/libtinyhttps.a | grep -c '\\.o$'   # all 6 partitions + 108 mbedtls .c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant